home *** CD-ROM | disk | FTP | other *** search
/ Totally for Newton 10 / PDA10.toast / mac / Packages / Programming / 2.x / TapBar SDK 1.0 / Sample 1 / Sample 1.def next >
Encoding:
Text File  |  1996-05-31  |  1.0 KB  |  60 lines  |  [TEXT/R*ch]

  1. /*====================================================================
  2.     Sample 1.def    ©1996 Yosuke "Basuke" Suzuki.
  3.     
  4.     Simple button based on protoTextButton. 
  5.     It displays simple alert.
  6.   ====================================================================*/
  7.  
  8. partData := {
  9.     
  10.     //
  11.     // Here is the definition of button frame.
  12.     //
  13.     
  14.     button: {
  15.             _proto: protoTextButton,
  16.             
  17.             buttonClickScript:
  18.                 func()
  19.                 begin
  20.                     :ClickStart(kAppSymbol);
  21.                     
  22.                     GetRoot():Notify(
  23.                                 kNotifyAlert, 
  24.                                 EnsureInternal("Sample 1"),
  25.                                 EnsureInternal("Hello World!"));
  26.                     
  27.                     :ClickFinish(true);
  28.                 end,
  29.             
  30.             viewBounds: {left:0, right:13, top:0, bottom:13},
  31.             
  32.             text: "Hi",
  33.             
  34.             title: "Sample 1 : Hello World",
  35.         }
  36. };
  37.  
  38.  
  39. InstallScript := func(partFrame,removeFrame)
  40. begin
  41.     
  42.     //
  43.     //    register button
  44.     //
  45.     
  46.     call kRegTapBarButtonFunc with (kAppSymbol, partFrame.partData.button);
  47. end;
  48.  
  49.  
  50. RemoveScript := func(removeFrame)
  51. begin
  52.     
  53.     //
  54.     //    unregister button
  55.     //
  56.     
  57.     call kUnRegTapBarButtonFunc with (kAppSymbol);
  58. end;
  59.  
  60.